package org.brain.pojos;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Userinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "USERINFO", schema = "PUBLIC", catalog = "PUBLIC")
public class Userinfo implements java.io.Serializable {

	// Fields

	private String userinfoid;
	private User user;
	private String userinfocareer;
	private Timestamp userinforegistertime;
	private Set<Messagetable> messagetables = new HashSet<Messagetable>(0);

	// Constructors

	/** default constructor */
	public Userinfo() {
	}

	/** minimal constructor */
	public Userinfo(User user) {
		this.user = user;
	}

	/** full constructor */
	public Userinfo(User user, String userinfocareer,
			Timestamp userinforegistertime, Set<Messagetable> messagetables) {
		this.user = user;
		this.userinfocareer = userinfocareer;
		this.userinforegistertime = userinforegistertime;
		this.messagetables = messagetables;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "USERINFOID", unique = true, nullable = false, length = 30)
	public String getUserinfoid() {
		return this.userinfoid;
	}

	public void setUserinfoid(String userinfoid) {
		this.userinfoid = userinfoid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USERINFOID", unique = true, nullable = false, insertable = false, updatable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "USERINFOCAREER", length = 30)
	public String getUserinfocareer() {
		return this.userinfocareer;
	}

	public void setUserinfocareer(String userinfocareer) {
		this.userinfocareer = userinfocareer;
	}

	@Column(name = "USERINFOREGISTERTIME", length = 26)
	public Timestamp getUserinforegistertime() {
		return this.userinforegistertime;
	}

	public void setUserinforegistertime(Timestamp userinforegistertime) {
		this.userinforegistertime = userinforegistertime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userinfo")
	public Set<Messagetable> getMessagetables() {
		return this.messagetables;
	}

	public void setMessagetables(Set<Messagetable> messagetables) {
		this.messagetables = messagetables;
	}

}